package imu.g3.service;

import imu.g3.dao.SystemLogMapper;
import imu.g3.dao.UserMapper;
import imu.g3.model.LoginLogInfo;
import imu.g3.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemLogService {

    @Autowired
    private SystemLogMapper systemLogMapper;
    @Autowired
    private UserMapper userMapper;
    /**
     * 查询所有的登录系统日志
     * @return
     */
    public List<LoginLogInfo> getLoginLog(){
        List<LoginLogInfo> LoginLogInfoList = systemLogMapper.getLoginLog();
        return LoginLogInfoList;
    }

    /**
     * 新增登录系统日志
     * @return
     */
    public int addLoginLog(LoginLogInfo loginLogInfo){
        int rs = 0;
        rs = systemLogMapper.addLoginLog(loginLogInfo);
       /* User user = new User();
        user.setRegDate("21321");
        rs = userMapper.register(user);*/
        return rs;
    }



}
